/* Monom.h header file
   -------------------
   specifies class properties and methods
 */

#ifndef _MONOM_H
#define _MONOM_H

#include <iostream>

using namespace std;


class Monom {
    friend ostream& operator<<(ostream &out, const Monom &m);         // Operator for 'cout << monom'
	friend const Monom operator*(const double &num, const Monom &m2); // Arithmetic multiplication <double> * Monom

public:
    // Constructors
	Monom(const double C=0,const int m=0);							// Constructor with default values (0,0)
    Monom(const Monom &m);                                          // Copy Constructor

    // non-const methods
    Monom& operator=(const Monom &m2);                              // Assignment operator --> Monom = Monom
    const Monom& derive() ;                                         // Method for derivative
	void setC(const double &num);									// C setter

    // inline const methods
	const int getExponent() const { return ((C == 0) ? 0 : m); };                    // Method for getting 'm' power
	const double getC() const { return C; };						// Method for getting 'C' scalar

    // Logic bit-wise operators
    bool operator!=(const Monom &m2) const;                         // Operator for != comparison
    bool operator==(const Monom &m2) const;                         // Operator for == comparison

    // Arithmetic operators
    const Monom operator^(const int &num) const;                    // Power operation: Monom^scalar
    const Monom operator/(const Monom &m2) const;                   // Arithmetic division: Monom / Monom
    const Monom operator/(const double &num) const;                 // Arithmetic division: Monom / scalar
    const Monom operator*(const Monom &m2) const;                   // Arithmetic multiplication: Monom * Monom
    const Monom operator*(const double &num) const;                 // Arithmetic multiplication: Monom * scalar
    void operator*=(const Monom &m2);                               // Arithmetic multiplication *= --> Monom*=Monom
    const Monom operator+(const Monom &m2) const;                   // Arithmetic addition: Monom + Monom
    void operator+=(const double &num);                             // Arithmetic addition += --> Monom+= scalar
    const Monom operator-(const Monom &m2) const;                   // Arithmetic subtraction: Monom - Monom
    const string operator()(const double &num) const;               // Operator for () C*num^m calculation

private:
	double C;
	int m;
};


#endif
